import React from "react";
import ctx from "./Context.js";

export default function CreateContextGrandSon(){
  const context = React.useContext(ctx);

  const grow = () => {
    context.grow(context.user.age + 1)
  }
  return (
    <div style={{border:"1px solid green",padding:8}}>
      GRANDSON:{context.user.name}|{context.user.age}
      <button onClick={grow}>grow 1秒后长1岁</button>
      </div>
  )
}
